<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<title>工作计划</title>
   <!--  <script src="__JS__/zepto.min.js"></script> -->
    <link href="__CSS__/weui.min.css" rel="stylesheet">
	<link rel="stylesheet" href="__SaleManager__/stylesheets/index.css">
	 <link rel="stylesheet" href="__SaleManager__/stylesheets/dropload.css">
	 <!-- 引用提图片放大镜 -->

       <link href="__SaleManager__/dist/site.css?v=4.1.1-1.0.4" rel="stylesheet" />
      <link href="__SaleManager__/dist/photoswipe.css?v=4.1.1-1.0.4" rel="stylesheet" />
      <link href="__SaleManager__/dist/default-skin/default-skin.css?v=4.1.1-1.0.4" rel="stylesheet" />
      <script src="__SaleManager__/dist/photoswipe.min.js?v=4.1.1-1.0.4"></script>
      <script src="__SaleManager__/dist/photoswipe-ui-default.min.js?v=4.1.1-1.0.4"></script>
      <!-- 引用提图片放大镜 -->
</head>
  <style type="text/css">
        .my-gallery{
          text-align: center;
          padding: 7px 30px;
        }
      </style>
<body>
	<div class="work_plan_w">
    <header class = "all_header">
      <a class = "h_back h_back_1" href="javascript:void(0);"><img src="__SaleManager__/images/back_icon.png" alt=""></a>
      <span class = "h_title">工作计划</span>
      <a class = "h_add" href="javascript:void(0)"></a>
    </header>
     <!-- 新增 -->
      <section class="work-report">
          <h6 class="title">
            <strong class="text">今日完成工作</strong>
            <span class="time">{$todaydata}</span>
          </h6>
          <div class="content-work">
          <volist name='today' id='t'>
          <div class="content-work">
            <ul class="wrok-list">
                <li>{$t.content}</li>
            </ul>
            <!-- 图片放大镜功能 -->
             <div class="my-gallery" itemscope itemtype="http://schema.org/ImageGallery">
             
             <volist name='t["bigimages"]' id='g'>
             <figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
                    <a href="{$g.images}" itemprop="contentUrl" data-size="400x600">

                        <img src="{$g.images}" itemprop="thumbnail" alt="工作计划" />
                    </a>
             </figure>
             </volist>
             
              
             
            </div>
            <!-- 图片放大镜功能 -->
            		
          </div>
           
             </volist>
           
          </div>
          <h6 class="title">
            <strong class="text">明日计划</strong>
            <span class="time">{$tomorrowdata}</span>
          </h6>
     <!--      <volist name='tomorrow' id='v'>
	        <div class="weui-cell">
	          <div class="weui-cell__bd">
	            <p>{$v.content}</p>
	          </div>
	          <div class="weui-cell__ft">{$v.work_day}</div>
	        </div>
        </volist> -->
       	<volist name='tomorrow' id='v'>
          	<ul class="wrok-list">
                <li>{$v.content}</li>
            </ul>
             </volist>
      </section>
     <!-- 新增 -->
		<!-- <div class="today_plan_c">
			<div class="weui-cells__title">今日完成工作</div>
			<div class="weui-cells">
		<volist name='today' id='t'>
        <div class="weui-cell">
          <div class="weui-cell__bd">
            <p>{$t.content}</p>
          </div>
          <div class="weui-cell__ft">{$t.work_day}</div>
        </div>
       </volist>
      </div>
		</div>
		<div class="tommrow_plan_c">
			<div class="weui-cells__title">明日计划</div>
			<div class="weui-cells">
       <volist name='tomorrow' id='v'>
        <div class="weui-cell">
          <div class="weui-cell__bd">
            <p>{$v.content}</p>
          </div>
          <div class="weui-cell__ft">{$v.work_day}</div>
        </div>
        </volist>
      </div>
		</div> -->
	</div>
	<!-- 图片放大镜demo. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element, as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
        <!-- don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

          </div>

        </div>

</div>
<!-- 图片放大镜demo. -->
 <script src="__SaleManager__/js/jquery.min.js"></script>
</body>
<script src = "__SaleManager__/js/index.js"></script>
<script src = "__SaleManager__/js/androidback.js"></script>
<script>
var initPhotoSwipeFromDOM = function(gallerySelector) {

    // parse slide data (url, title, size ...) from DOM elements 
    // (children of gallerySelector)
    var parseThumbnailElements = function(el) {
        var thumbElements = el.childNodes,
            numNodes = thumbElements.length,
            items = [],
            figureEl,
            linkEl,
            size,
            item;

        for(var i = 0; i < numNodes; i++) {

            figureEl = thumbElements[i]; // <figure> element

            // include only element nodes 
            if(figureEl.nodeType !== 1) {
                continue;
            }

            linkEl = figureEl.children[0]; // <a> element
			imagewidth=figureEl.children[0].children[0].width;
			imageheight=figureEl.children[0].children[0].height;
            size = linkEl.getAttribute('data-size').split('x');
            size[1]=size[0]/(imagewidth/imageheight);
            // create slide object
            item = {
                src: linkEl.getAttribute('href'),
                w: parseInt(size[0], 10),
                h: parseInt(size[1], 10)
            };



            if(figureEl.children.length > 1) {
                // <figcaption> content
                item.title = figureEl.children[1].innerHTML; 
            }

            if(linkEl.children.length > 0) {
                // <img> thumbnail element, retrieving thumbnail url
                item.msrc = linkEl.children[0].getAttribute('src');
            } 

            item.el = figureEl; // save link to element for getThumbBoundsFn
            items.push(item);
        }

        return items;
    };

    // find nearest parent element
    var closest = function closest(el, fn) {
        return el && ( fn(el) ? el : closest(el.parentNode, fn) );
    };

    // triggers when user clicks on thumbnail
    var onThumbnailsClick = function(e) {
        e = e || window.event;
        e.preventDefault ? e.preventDefault() : e.returnValue = false;

        var eTarget = e.target || e.srcElement;

        // find root element of slide
        var clickedListItem = closest(eTarget, function(el) {
            return (el.tagName && el.tagName.toUpperCase() === 'FIGURE');
        });

        if(!clickedListItem) {
            return;
        }

        // find index of clicked item by looping through all child nodes
        // alternatively, you may define index via data- attribute
        var clickedGallery = clickedListItem.parentNode,
            childNodes = clickedListItem.parentNode.childNodes,
            numChildNodes = childNodes.length,
            nodeIndex = 0,
            index;

        for (var i = 0; i < numChildNodes; i++) {
            if(childNodes[i].nodeType !== 1) { 
                continue; 
            }

            if(childNodes[i] === clickedListItem) {
                index = nodeIndex;
                break;
            }
            nodeIndex++;
        }



        if(index >= 0) {
            // open PhotoSwipe if valid index found
            openPhotoSwipe( index, clickedGallery );
        }
        return false;
    };

    // parse picture index and gallery index from URL (#&pid=1&gid=2)
    var photoswipeParseHash = function() {
        var hash = window.location.hash.substring(1),
        params = {};

        if(hash.length < 5) {
            return params;
        }

        var vars = hash.split('&');
        for (var i = 0; i < vars.length; i++) {
            if(!vars[i]) {
                continue;
            }
            var pair = vars[i].split('=');  
            if(pair.length < 2) {
                continue;
            }           
            params[pair[0]] = pair[1];
        }

        if(params.gid) {
            params.gid = parseInt(params.gid, 10);
        }

        return params;
    };

    var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) {
        var pswpElement = document.querySelectorAll('.pswp')[0],
            gallery,
            options,
            items;

        items = parseThumbnailElements(galleryElement);

        // define options (if needed)
        options = {

            // define gallery index (for URL)
            galleryUID: galleryElement.getAttribute('data-pswp-uid'),

            getThumbBoundsFn: function(index) {
                // See Options -> getThumbBoundsFn section of documentation for more info
                var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail
                    pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
                    rect = thumbnail.getBoundingClientRect(); 

                return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
            }

        };

        // PhotoSwipe opened from URL
        if(fromURL) {
            if(options.galleryPIDs) {
                // parse real index when custom PIDs are used 
                // http://photoswipe.com/documentation/faq.html#custom-pid-in-url
                for(var j = 0; j < items.length; j++) {
                    if(items[j].pid == index) {
                        options.index = j;
                        break;
                    }
                }
            } else {
                // in URL indexes start from 1
                options.index = parseInt(index, 10) - 1;
            }
        } else {
            options.index = parseInt(index, 10);
        }

        // exit if index not found
        if( isNaN(options.index) ) {
            return;
        }

        if(disableAnimation) {
            options.showAnimationDuration = 0;
        }

        // Pass data to PhotoSwipe and initialize it
        gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
        gallery.init();
    };

    // loop through all gallery elements and bind events
    var galleryElements = document.querySelectorAll( gallerySelector );

    for(var i = 0, l = galleryElements.length; i < l; i++) {
        galleryElements[i].setAttribute('data-pswp-uid', i+1);
        galleryElements[i].onclick = onThumbnailsClick;
    }

    // Parse URL and open gallery if it contains #&pid=3&gid=1
    var hashData = photoswipeParseHash();
    if(hashData.pid && hashData.gid) {
        openPhotoSwipe( hashData.pid ,  galleryElements[ hashData.gid - 1 ], true, true );
    }
};

// execute above function
initPhotoSwipeFromDOM('.my-gallery');
</script>
</html>